<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>高考分数线查询系统</title>
    <link rel="stylesheet" href="css/style.css">
    <link rel="stylesheet" href="css/bootstrap.min.css">
</head>
<style>
    .menu {
        padding: 0 10px 10px;
    }
</style>
<body>
<nav class="navbar navbar-default" role="navigation">
    <div class="container-fluid">
        <div class="navbar-header">
            <a class="navbar-brand" href="province.html">各省份历年录取分数查询</a>
        </div>
        <div class="navbar-header">
            <a class="navbar-brand" href="college.html">各院校录取分数线查询</a>
        </div>
        <div class="navbar-header">
            <a class="navbar-brand" href="https://www.eol.cn/e_html/gk/chafen/index.shtml">高考查分</a>
        </div>
        <div class="navbar-header">
            <a class="navbar-brand" href="https://gkcx.eol.cn/">志愿填报</a>
        </div>
        <div class="navbar-header">
            <a class="navbar-brand" href="http://query.bjeea.cn/queryService/rest/admission/110">录取通知书查询</a>
        </div>
        <div class="navbar-header">
            <a class="navbar-brand" href="https://gkcx.eol.cn/school/search">院校排行</a>
        </div>
        <div class="navbar-header">
            <a class="navbar-brand" href="time.html">高考时间查询</a>
        </div>
        <div class="navbar-header">
            <a class="navbar-brand" href="major.html">专业查询</a>
        </div>
    </div>
</nav>
<div class="menu">
    <input class="college">输入学校</input>
    <button class="search_btn">搜索学校</button>
    <div class="result"></div>
</div>
</body>
<script type="text/javascript" src="http://www.jb51.net/jslib/jquery/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script type="text/javascript">
    function gaokao(result) {
        sessionStorage.setItem('college', JSON.stringify(result))
    }

    var college = JSON.parse(sessionStorage.getItem('college'))

    $('.search_btn').click(function () {
        $('.result').empty()
        var a = $('.college').val()
        college.map(function (item) {
            for (var key in item['title']) {
                if (key.indexOf(a) != -1) {
                    console.log(key, item['title'][key])
                    var url = item['title'][key]
                    var name = "<h3><a target=\"_blank\" href=" + url + ">" + key + "</a></h3>"
                    $('.result').append(name)
                }
            }
        })
    })

</script>
<script type="text/javascript" src="college.json?callback=gaokao"></script>

</html>